package Thread;

public class Demo8 {
    private static int sum = 0;
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                sum += i;
            }
        });
        t.start();
        t.join();
        System.out.println(sum);
    }
}
